import fetch from '@/utils/fetch';

export function getList(query) {
    query._ts = (new Date()).getTime();
    return fetch({
        url: '/statistics/user/list',
        method: 'get',
        params: query
    });
}


export function getDetail(userId) {
    var _ts = (new Date()).getTime();
    return fetch({
        url: '/statistics/user/detail',
        method: 'get',
        params: {
            userId,
            _ts
        }
    });
}

export function getUserOrders(query) {
    query._ts = (new Date()).getTime();
    return fetch({
        url: '/statistics/user/orders',
        method: 'get',
        params: query
    });
}


export function toggleBlack(userId, black) {
    return fetch({
        url: '/statistics/user/setblack',
        method: 'post',
        data: {
            userId,
            black
        }
    });
}





